package com.sweets.look.ui.view;

import android.app.Activity;
import android.view.View;
import android.widget.PopupWindow;

import com.sweets.look.ui.activity.BrowserActivity;

/**
 * Author   Shone
 * Date     19/07/16.
 * Github   https://github.com/shonegg
 */
public class SimplePopupWindow extends PopupWindow {

    private final Activity mActivity;

    public SimplePopupWindow(Activity activity) {
        super(activity);
        this.mActivity = activity;
    }


    @Override
    public void dismiss() {
        super.dismiss();
        if (mActivity instanceof BrowserActivity) {
            ((BrowserActivity) mActivity).hideShadeView();
        }
    }

    @Override
    public void showAtLocation(View parent, int gravity, int x, int y) {
        super.showAtLocation(parent, gravity, x, y);
        if (mActivity instanceof BrowserActivity) {
            ((BrowserActivity) mActivity).showShadeView();
        }
    }

}
